//
//  BVServiceNoteViewController.m
//  BuyVegetable
//
//  Created by yushanchang on 16/10/4.
//  Copyright © 2016年 com.yinding. All rights reserved.
//

#import "BVServiceNoteViewController.h"
#import "BVAboutJingCaiViewController.h"
@interface BVServiceNoteViewController ()<UITableViewDelegate,UITableViewDataSource>
@property (nonatomic,strong)UITableView * tableView;
@property (nonatomic,strong)NSArray * arrayTitel;

@end

@implementation BVServiceNoteViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.navigationItem.title = @"服务须知";
    
    [self setUI];
}

- (UITableView *)tableView{
    
    if (!_tableView) {
        _tableView = [[UITableView alloc]initWithFrame:CGRectMake(0, 0, ScreenW, ScreenH) style:UITableViewStylePlain];
        _tableView.delegate = self;
        _tableView.dataSource = self;
        _tableView.rowHeight = 45;
        [_tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:@"iden"];
    }
    return _tableView;
    
}
-(void)setUI{
    
    [self.view addSubview:self.tableView];
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    
    return 3;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    
    UITableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:@"iden"];
    cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
    cell.imageView.image = [UIImage imageNamed:[NSString stringWithFormat:@"%@",self.arrayTitel[indexPath.row][@"image"]]];
    cell.textLabel.text = self.arrayTitel[indexPath.row][@"title"];
    cell.textLabel.textColor = [UIColor BVTextGrayColor];
    return cell;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    [tableView deselectRowAtIndexPath:indexPath animated:NO];
    
    if (indexPath.row == 0) {
        
    }else if (indexPath.row == 1){
        
    }else if (indexPath.row == 2){
        BVAboutJingCaiViewController * aboutJingCai = [[BVAboutJingCaiViewController alloc]init];
        [self.navigationController pushViewController:aboutJingCai animated:YES];
    }
}
-(NSArray *)arrayTitel{
    if (!_arrayTitel) {
        _arrayTitel = @[@{@"image":@"fuwutiaokuan",@"title":@"服务条款"},
                        @{@"image":@"guanyuwomen",@"title":@"售后规则"},
                        @{@"image":@"shouhuodizhi",@"title":@"关于我们"},
                        ];
    }
    return _arrayTitel;
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
